﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HFK.DxFluentUI.DataProvider
{
  public class DataProviderList
  {
    public void AddCall<A, R>(string key, Func<A, IList<R>> methodCall) where A : class
    {
      CallWrapper<A, IList<R>> wrappedCall = new CallWrapper<A, IList<R>>(methodCall);
      m_callList.Add(key, wrappedCall);
    }

    public object ExecuteCallOnObject(string key, object o)
    {
      return m_callList[key].Call(o);
    }

    private Dictionary<string, ICallWrapper> m_callList = new Dictionary<string, ICallWrapper>();
  }
}
